package pais.robot.keyextr;


public class KoreanKeywordExtractor { 
  /*	
    implements KeywordExtractor {
	private MorphemeAnalyzer koreanTextAnalyzer_ = null;
	private String           text_ = null;
	private KeywordListener listener_ = null;
	public void setText(String text, int offsetInDocument) {
		text_ = text;
		try {
			if ( koreanTextAnalyzer_ == null )
				koreanTextAnalyzer_ = new MorphemeAnalyzer();
		} catch (Exception e) {
			System.err.println("Error Initializing Korean Keyword Extractor : ");
			e.printStackTrace();
			System.exit(-1);
		}
	}
	public void setKeywordListener(KeywordListener listener) {
		listener_ = listener;
	}
	public void extractAll() {
		try {
			StringTokenizer stok = new StringTokenizer(text_, " \t\r\n~!@#$%^&*()-=_+[]\\{}|;':\",./<>?");
			while(stok.hasMoreTokens()) {

				HashSet keywordSet = koreanTextAnalyzer_.parse( stok.nextToken() );
				Iterator i = keywordSet.iterator();
				while ( i.hasNext() ) {
					// PAIS_BUG: Should calculate offset of the keyword in the document instead of 0 
					listener_.onKeyword((String)i.next(), 0);
				}
			}

		} catch (Exception e) {
			// PAIS_BUG: Consider logging message instead of exit 
			System.err.println("Error Extracting Korean Keyword : ");
			e.printStackTrace();
			System.exit(-1);
		}
	}
   */	
}
